import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home/Home'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: Home
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  },
  {
    path: '/login',
    name: 'login',
    component: () => import(/* webpackChunkName: "login" */ '../views/users/login.vue')
  },
  {
    path: '/register',
    name: 'register',
    component: () => import(/* webpackChunkName: "login" */ '../views/users/register.vue')
  },
  {
    path: '/personal',
    name: 'personal',
    component: () => import(/* webpackChunkName: "personal" */ '../views/users/personal.vue'),
  },
  {
    path: '/personalset',
    name: 'personalset',
    component: () => import(/* webpackChunkName: "personalset" */ '../views/users/personalset.vue'),
  },
  {
    path: '/menu/:tids',
    name: 'menu',
    component: () => import(/* webpackChunkName: "menu" */ '../views/Menu/menu.vue'),props:true
  },
  {
    path: '/menudetails/:cid/:cname',
    name: 'menudetails',
    component: () => import(/* webpackChunkName: "menudetails" */ '../views/Menu/menudetails.vue'),props:true
  },
  {
    path: '/collect',
    name: 'collect',
    component: () => import(/* webpackChunkName: "collect" */ '../views/Collect/collect.vue')
  },
  {
    path: '/updatepwd',
    name: 'updatepwd',
    component: () => import(/* webpackChunkName: "updatepwd" */ '../views/users/updatepwd.vue')
  },
]

const router = new VueRouter({
  routes
})

export default router
